function [V] = valve_list();
% get a valve list
DFILE = datac('getdfile');
CONTROL = datac('control');
sf=44;
frec = DFILE.frec;
lrec = DFILE.lrec;
truefile = parse_filename(CONTROL(sf).path, CONTROL(sf).filename); % get the filename like this...
[zfile, d, err] = datac2mat(truefile, [0]); % 0 record list gets all the 'ztime' info
ztime=zfile.ztime;
ZT = (ztime - ztime(1))/1000; % relative to first record in present analysis
n=length(ZT);
while(any(diff(ZT)<0))
	j=find(diff(ZT)<0);
	if(j(1)==1)
		ZT(1)=ZT(2);
	end;
	k=j(1)+1; % index of first reset time
	z=ZT(j(1));
	ZT(k:n)=ZT(k:n)+z;

end
ZT=ZT-ZT(DFILE.frec); % make relative to start of current analysis
% access ZT with the record number (1..n) to get the corresponding ztime
% have to get the records first
p=datac('getnote');
	t_sw_valve=[];
	n_valve=[];
if(~isempty(p)) % there should be some, but if not, don;'t do much
% first set of arrays are immediate representations.
		sw_valve=[1 [p(find(diff([p.valve])~=0)+1).frec]];	% valve switch list (records)
		if(length(sw_valve) > 1)
			n_valve=[1 p(find(diff([p.valve])~=0)+1).valve]; % which valve...
			t_sw_valve=ZT(sw_valve); % don't forget offset from start of data..
% now make long time arrays to match the other arrays.
			for i = frec:lrec
				TL(i)=ZT(i);
				for j=1:length(sw_valve)
					if(i >= sw_valve(j))
						VL(i)=n_valve(j);
					end;
				end;
			end;
		end;
end;
V.VL=VL;
V.TL=TL;
V.sw=sw_valve;
V.n=n_valve;
return;
